c 
c Copyright (C) 1993, Silicon Graphics, Inc.
c All Rights Reserved.
c
	subroutine bloc_mpy(c1,c2,m,n,p,alpha,a,lda,b,ldb,beta,c,ldc,
     +   iflag)
c
	implicit double precision(a-h,o-z)
	character*1 c1,c2
	real*8 alpha,beta
	dimension a(lda,p),b(ldb,n),c(ldc,n)
	parameter(iblock=64,kblock=32,jblock=16)
	integer p
c

	do j1=1,n,jblock
	  j2=j1+jblock-1
	  if(j2.gt.n) j2=n
	  do k1=1,p,kblock
		k2=k1+kblock-1
		if(k2.gt.p)k2=p
		do i1=1,m,iblock
		   i2=i1+iblock-1
	 	   if(i2.gt.m) i2=m
c         call sgi_dgemm_mm( a(i1,k1),lda,b(k1,j1),ldb,c(i1,j1),ldc,
          call mpy( a(i1,k1),lda,b(k1,j1),ldb,c(i1,j1),ldc,
     $                   (i2-i1+1), (j2-j1+1), (k2-k1+1), alpha)

	enddo
	enddo
	enddo


	return
	end
